package com.fit.entities.manytomany;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

import com.fit.entities.Organization;
import com.fit.entities.User;

@Embeddable
public class UserOrganPk implements Serializable{

	@ManyToOne
	private User user;
	@ManyToOne
	Organization organization;
	
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public Organization getOrganization() {
		return organization;
	}
	public void setOrganization(Organization organization) {
		this.organization = organization;
	}
	
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		UserOrganPk that = (UserOrganPk) o;

		if (user != null ? !user.equals(that.user) : that.user != null)
			return false;
		if (organization != null ? !organization.equals(that.organization)
				: that.organization != null)
			return false;

		return true;
	}
	
}
